<div class="content">
	<form class="form-horizontal" name="raceForm" ng-submit="vm.submitForm(raceForm.$valid)" novalidate>
        <div class="ibox">
            <div class="ibox-title">
                <h5>基本信息</h5>
            </div>
            <div class="ibox-content">
                <div class="form-group has-feedback" ng-class="{'has-success': raceForm.raceName.$valid, 'has-error': raceForm.raceName.$invalid && !raceForm.raceName.$pristine}">
                    <label class="col-lg-3 control-label">赛事名称 <b class="text-danger">*</b></label>
                    <div class="col-lg-3">
                        <input type="text" name="raceName" class="form-control" placeholder="请输入赛事名称" ng-model="vm.race.race_name" ng-minlength="2" ng-maxlength="20" required>
                        <span class="glyphicon form-control-feedback" ng-class="{'glyphicon-ok': raceForm.raceName.$dirty && raceForm.raceName.$valid, 'glyphicon-remove': raceForm.raceName.$dirty && raceForm.raceName.$invalid}" ng-show="raceForm.raceName.$dirty"></span>
                        <div class="m-t-xs" ng-show="!raceForm.raceName.$pristine" ng-messages="raceForm.raceName.$error" ng-messages-multiple>
                            <div ng-messages-include="{{vm.textHtml}}"></div>
                        </div>
                    </div>
                </div>
                <div class="form-group has-feedback" ng-class="{'has-success': raceForm.raceShortName.$valid, 'has-error': raceForm.raceShortName.$invalid && !raceForm.raceShortName.$pristine}">
                    <label class="col-lg-3 control-label">赛事短名 <b class="text-danger">*</b></label>
                    <div class="col-lg-3">
                        <input type="text" name="raceShortName" class="form-control" placeholder="请输入赛事短名" ng-model="vm.race.race_short_name" ng-pattern="/^[A-Za-z0-9_]*$/" ng-minlength="2" ng-maxlength="20" disabled required>
                        <p class="help-block text-danger">赛事短名用于生成赛事唯一的网址和二维码。请使用英文字母，数字，下划线。一旦设置后则不可修改。</p>
                        <span class="glyphicon form-control-feedback" ng-class="{'glyphicon-ok': raceForm.raceShortName.$dirty && raceForm.raceShortName.$valid, 'glyphicon-remove': raceForm.raceShortName.$dirty && raceForm.raceShortName.$invalid}" ng-show="raceForm.raceShortName.$dirty"></span>
                        <div class="m-t-xs" ng-show="!raceForm.raceShortName.$pristine" ng-messages="raceForm.raceShortName.$error" ng-messages-multiple>
                            <div ng-messages-include="{{vm.textHtml}}"></div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                        <label class="col-lg-3 control-label">赛事开始时间 <b class="text-danger">*</b></label>
                        <div class="col-lg-3">
                            <div class="input-group date">
                              <input name="raceDate" type="text" size="10" class="form-control" ng-model="vm.race.race_event_date" data-date-format="yyyy-MM-dd" data-autoclose="1" placeholder="年-月-日" bs-datepicker required>
                              <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="input-group date">
                                <input name="raceTime" type="text" size="10" class="form-control" ng-model="vm.race.race_start_time" data-time-format="HH:mm:ss" data-autoclose="1" placeholder="时:分:秒" bs-timepicker required>
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-lg-3 control-label">赛事结束时间 <b class="text-danger">*</b></label>
                        <div class="col-lg-3">
                            <div class="input-group date">
                              <input name="raceDate" type="text" size="10" class="form-control" ng-model="vm.race.race_end_date" data-date-format="yyyy-MM-dd" data-autoclose="1" placeholder="年-月-日" bs-datepicker required>
                              <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                        <div class="col-lg-2">
                            <div class="input-group date">
                                <input name="raceTime" type="text" size="10" class="form-control" ng-model="vm.race.race_end_time" data-time-format="HH:mm:ss" data-autoclose="1" placeholder="时:分:秒" bs-timepicker required>
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            </div>
                        </div>
                    </div>
                <div class="form-group">
                    <label class="col-lg-3 control-label">赛事所在城市</label>
                    <div class="col-lg-3">
                        <div class="row">
                            <div class="col-lg-12 margin-bottom-20">
                                <select class="form-control" ng-model="vm.race.race_province" ng-options="item.name for item in vm.province" ng-change="vm.onChangeProvince(vm.race.race_province)">  
                                    <option value="">请选择省份</option>  
                                </select>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-12 margin-bottom-20" ng-if="vm.race.race_province"> 
                                <select class="form-control" ng-model="vm.race.race_city" ng-options="item.name for item in vm.cities" ng-change="vm.onChangeCity(vm.race.race_city)">  
                                    <option value="">请选择城市</option>  
                                </select> 
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-lg-12 margin-bottom-20" ng-if="vm.race.race_city"> 
                                <select class="form-control" ng-model="vm.race.race_district" ng-options="item.name for item in vm.district">  
                                    <option value="">请选择地区</option>  
                                </select> 
                            </div>
                        </div>
                    </div>
                </div>
                <!-- <div class="form-group">
                    <label class="col-lg-3 control-label">赛事列表显示设置</label>
                    <div class="col-lg-3">
                        <label class="checkbox">
                            <input icheck type="checkbox" ng-model="vm.race.race_show"> 显示赛事
                        </label>
                        <label class="checkbox" ng-if="vm.race.race_show">
                            <input icheck type="checkbox" ng-model="vm.race.live_show"> 开通赛事直播
                        </label>
                        <label class="checkbox" ng-if="vm.race.race_show">
                            <input icheck type="checkbox" ng-model="vm.race.search_result_show"> 开通查询成绩
                        </label>  
                    </div>
                </div> -->
                <!-- <div class="form-group">
                    <label class="col-lg-3 control-label sr-only"></label>
                    <div class="col-lg-8">
                        <p class="help-block text-danger">提示：如果不勾选显示赛事，则赛事列表中不会显示该赛事。<a style="text-decoration: underline;" ng-click="vm.preview()">点击这里</a> 查看示例。</p>
                    </div>
                </div> -->
                <!-- <div class="form-group" ng-if="vm.race.race_show">
                    <label class="col-lg-3 control-label">赛事状态</label>
                    <div class="col-lg-3">
                        <select class="form-control" ng-model="vm.race.status" ng-options="item.text for item in vm.race_status_list">  
                            <option value="">请选择赛事状态</option>  
                        </select>
                    </div>
                </div> -->
                <div class="form-group">
                    <label class="col-lg-3 control-label">赛事成绩展示页面背景图 <b class="text-danger">*</b></label>
                    <div class="col-lg-8">
                        <div class="upload-logo bg">
                            <img ng-src="{{vm.imageSrc2}}" id="act_image" ng-show="vm.imageSrc2">
                            <input class="input-file" type="file" name="image" file-model="vm.myFile2" file-fn="vm.getFile2()">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-3 control-label">赛事LOGO <b class="text-danger">*</b></label>
                    <div class="col-lg-8">
                        <div class="upload-logo">
                            <img ng-src="{{vm.imageSrc}}" id="act_image" ng-show="vm.imageSrc">
                            <input class="input-file" type="file" name="image" file-model="vm.myFile" file-fn="vm.getFile()">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-lg-offset-3 col-lg-3">
                        <button type="button" class="btn btn-sm btn-default" ui-sref="dashboard.race.index"><i class="fa fa-times"></i>取消</button>
                    <button type="submit" class="btn btn-sm btn-primary" ng-disabled="hide"><i class="fa fa-save"></i>保存</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- 赛事概要 -->
        <div class="ibox">
            <div class="ibox-title">
                <h5>赛事概要</h5>
                <div ibox-tools>
                    <div class="ibox-tools dropdown">
                        <button ng-if="!vm.hide" type="button" class="btn btn-sm btn-primary m-t-n-xs" ng-click="vm.setShow()">编辑</button>
                    </div>
                </div>
            </div>
            <div class="ibox-content no-padding margin-bottom-20">
                <div ng-if="vm.detail&&!vm.hide" class="detail" ng-bind-html="vm.detail"></div>
                <div ng-if="!vm.detail&&!vm.hide" class="detail">暂无赛事详情。</div>

                <script style="width:90%;" id="editor" name="content"></script>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <button ng-if="vm.hide" type="button" class="btn btn-sm btn-primary" ng-click="vm.save()"><i class="fa fa-save"></i>保存</button>
                <button ng-if="vm.hide" type="button" class="btn btn-sm btn-primary" ng-click="vm.setFocus()"><i class="fa fa-eye"></i>预览</button>
            </div>
        </div>


    </form>
</div>